package com.bw.controller;

import com.bw.domain.Result;
import com.bw.domain.SysDw;
import com.bw.domain.SysGhs;
import com.bw.domain.SysType;
import com.bw.service.SysDwService;
import com.bw.service.SysGhsService;
import com.bw.service.SysTypeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author bobo棒
 * @date 2024年04月15日 11:45
 */
@CrossOrigin
@RestController
@RequestMapping("type")
public class TypeController {

    @Autowired
    RedisTemplate redisTemplate;

    /**
     * 查询供货商
     * @return
     */
    @RequestMapping("listGHS")
    public Result list(){
        List<SysGhs> list = redisTemplate.opsForList().range("ghs", 0, -1);
        return Result.success(list);
    }
    /**
     * 查询类型
     * @return
     */
    @RequestMapping("listTypes")
    public Result listTypes(){
        List<SysType> list = redisTemplate.opsForList().range("types", 0, -1);
        return Result.success(list);
    }
    /**
     * 查询dw
     * @return
     */
    @RequestMapping("listDW")
    public Result listDW(){
        List<SysDw> list = redisTemplate.opsForList().range("dw", 0, -1);

        return Result.success(list);
    }


}
